package com.api.order;

import com.edu.entity.HfdOrderInfo;
import com.edu.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>title: com.api.</p>
 * author
 * description:
 */
@Component
//远程调用
@FeignClient("edu-order")
@RequestMapping("/order")
public interface OrderClient {

    //根据orderId查询订单
    @RequestMapping("findOrderById")
    public HfdOrderInfo findOrderById(@RequestParam("orderId") String orderId);

    //超时订单修改状态
    @RequestMapping("releaseOrder")
    public Result releaseOrder(@RequestParam("orderId") String orderId);

    //修改订单状态
    @RequestMapping("update")
    public Result update(@RequestBody HfdOrderInfo hfdOrderInfo);

    //购买成功后添加用户_课程中间表
    @RequestMapping("addUserVideo")
    public Result addUserVideo(@RequestBody HfdOrderInfo hfdOrderInfo);
}
